//
//  lxDBAccessor.h
//  luodansc
//
//  Created by 倫 星 on 2012/10/20.
//  Copyright (c) 2012年 方正株式会社. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "/usr/include/sqlite3.h"

@class lxbaseEntity;
@interface lxDBAccessor : NSObject {
	NSMutableString * _strCurrentKey;// for xml paser
	NSDictionary * _sqlDictionary;
@private
	sqlite3 * _database;
	BOOL _isSqlXmlParserd;
	BOOL _isDbOpend;
}

@property(nonatomic ,assign)sqlite3 * database;
@property(nonatomic ,retain)NSDictionary * sqlDictionary;
@property(nonatomic ,assign)BOOL isSqlXmlParserd;
@property(nonatomic ,assign)BOOL isDbOpend;

+ (lxDBAccessor *)sharedLxDBAccessor;
- (BOOL)openDataBase;
- (void)closeDataBase;

- (BOOL)execute:(NSString *)sqlStatement;
- (BOOL)startTransaction;
- (BOOL)commitTransaction;
- (BOOL)rollBackTransaction;

//////////////業務開始////////////
- (lxbaseEntity *)getAppInfo;
- (lxbaseEntity *)getUserInfo;

- (BOOL)setAppInfo:(lxbaseEntity *)entity;
- (BOOL)setUserInfo:(lxbaseEntity *)entity;

- (BOOL)delUser;

@end
